这个问题非常适合你现在的阶段。
以你的背景(React / Next.js / TypeScript Senior Full-Stack)来说,你不是缺技术知识,你真正缺的是:
“美国前端 YouTuber 的口语化表达 + 工程师之间默认共享的语境。”
Jack Herrington、Syntax.fm(Wes Bos、Scott Tolinski)他们的视频不是像官方文档一样讲:
"React Server Components are components rendered on the server."
他们更常说:
"The cool thing about this approach is that you don't have to ship that JavaScript to the client."
或者:
"This is kind of a footgun."
如果不了解这些表达,即使每个单词都认识,也听不懂。
我会分很多 Part 给你整理。
这是他们开视频最常用。
意思:
我们来看一下……
例:
Let's take a look at how Server Actions work.
意思:
我们来看一下 Server Actions 是怎么工作的。
类似:
非常高频。
字面:潜入。
实际:
深入研究。
例如:
Let's dive into React Server Components.
意思:
我们深入讲一下 React Server Components。
你会听到:
Today we're gonna dive into a really interesting pattern.
这是美国技术视频必须听懂的。
不是:
"We are going to"
而是:
"We're gonna"
例如:
We're gonna build a todo app.
意思:
我们要做一个 todo app。
视频里:
80% 都是 gonna。
非常重要。
意思:我要展示给你。
例如:
I'm gonna show you how this works under the hood.
under the hood 后面讲。
超级重要。
字面:在引擎盖下面。
程序员意思:
底层原理。
例如:
Let's see what's happening under the hood.
意思:
我们看看底层发生了什么。
React 视频:
How does React work under the hood?
= React 内部机制是什么?
你之前学 Fiber、Scheduler,就是这个方向。
非常高频。
意思:关键是……
例如:
The thing is, React doesn't actually update the DOM immediately.
关键是:React 并不会立即更新 DOM。
意思:这个背后的思想是。
例如:
The idea behind Server Components is reducing client-side JavaScript.
原因是。
例如:
The reason why we use memoization is to avoid unnecessary renders.
描述流程。
例如:
What happens is React creates a new Fiber tree.
意思:
实际发生的是 React 创建一个新的 Fiber tree。
超级超级高频。
意思:简单来说。
例如:
Basically, useMemo caches the result.
简单来说,useMemo 缓存结果。
注意:
美国工程师喜欢说:
Basically...
然后解释。
和 basically 类似。
区别:
basically = 简单解释
essentially = 本质上
例如:
React Server Components are essentially server-rendered components.
超级重要。
意思:有点、某种程度。
例如:
It's kind of like a cache layer.
它有点像一个缓存层。
不要翻译:
“它是一个缓存层”
因为 kind of 表示“不完全等同”。
和 kind of 一样。
例如:
It's sort of a wrapper around fetch.
它算是一层 fetch wrapper。
意思:基本上。
例如:
That's pretty much how React works.
基本上 React 就这样工作。
非常常见。
很多中国学生误解。
不是:实际上(每次)
更多情况下表示:“纠正一下”
例如:
A:
useEffect runs during rendering.
B:
Actually, it runs after rendering.
这里 actually:
等等,其实不是。
非常美国工程师。
意思:归根到底。
例如:
At the end of the day, performance is about user experience.
归根到底:
性能是用户体验。
意思:从……角度。
例如:
In terms of performance, this approach is better.
从性能角度,这个方案更好。
非常常用。
意思:说到……
例如:
When it comes to React performance, memoization is important.
说 React 性能优化时,memoization 很重要。
意思:最大的几个之一。
例如:
One of the biggest problems with this approach is complexity.
高级工程师必听懂。
意思:代价是。
例如:
The trade-off is you have more server complexity.
这个方案的代价是:
服务器复杂度增加。
缺点。
例如:
The downside is you need more configuration.
优点。
例如:
The upside is better performance.
好处。
缺点。
超级工程师回答。
意思:看情况。
例如:
Q:
Should I use Server Actions?
A:
It depends.
非常高级。
意思:最终取决于。
例如:
It comes down to your use case.
最终取决于你的使用场景。
意思:这就是……的优点。
例如:
That's the beauty of React.
意思:这就是……强大的地方。
例如:
That's the power of TypeScript.
非常重要。
gotcha = got you
程序员意思:坑。
例如:
One gotcha here is hydration mismatch.
这里有一个坑:
hydration mismatch。
高级视频常出现。
意思:容易误用的东西。
例如:
useEffect can be a footgun if you don't understand dependencies.
如果不了解 dependency,useEffect 很容易踩坑。
注意……
例如:
Be careful with unnecessary state.
记住。
例如:
Keep in mind this only works on the server.
非常常见。
意思:你不应该。
例如:
You don't want to fetch data inside useEffect anymore.
意思:你大概率应该。
例如:
You probably want to use React Query here.
推荐。
例如:
I would recommend using Zod for validation.
个人偏好。
例如:
I personally prefer server components.
非常常见。
意思:我很喜欢。
例如:
I'm a big fan of TypeScript.
我不喜欢。
例如:
I'm not a fan of Redux anymore.
感觉奇怪。
感觉设计不对。
很棒。
例如:
This API is pretty neat.
很强。
非常方便。
例如:
This hook is really handy.
节省大量时间。
解决……问题。
例如:
Suspense solves the problem of loading states.
非常重要。
意思:你可以把它理解为。
例如:
You can think of Fiber as a unit of work.
这个你一定会听到。
换个角度想。
假设。
假设。
例如:
Let's say we have a large table.
举例。
这一部分非常关键,因为 Jack Herrington、Syntax.fm、Theo、Web Dev Simplified 讲 React 时,真正困难的不是术语,而是他们会把术语放进非常口语化的句子里面。
比如:
你知道:
hydration = 水合
但是视频里他说:
"The problem is you're shipping a bunch of JavaScript just to hydrate a component that doesn't really need to be interactive."
如果不知道这些固定表达,你还是听不懂。
所以这一部分专门整理:
这是 React 视频出现最多的词。
注意:
render 不一定是 “显示”
React 里面:
React calls your component function again.
例如:
When state changes, React triggers a re-render.
意思:
state 改变,React 重新执行组件函数。
重新渲染。
高频:
unnecessary re-renders
意思:不必要的重新渲染。
你面试说:
We reduced unnecessary re-renders by 80%.
美国工程师完全理解。
非常常见。
意思:触发渲染。
例如:
Updating state triggers a render.
导致重新渲染。
例如:
Changing this object reference will cause a re-render.
阻止不必要渲染。
例如:
React.memo helps prevent unnecessary renders.
跳过渲染。
例如:
React can skip rendering if the props haven't changed.
非常重要。
React 视频经常说:
React can bail out of rendering.
意思:
提前退出,不继续更新。
例如:
useState:
xxxxxxxxxxsetState(oldValue)React 使用 Object.is 判断。
如果一样:
React bails out.
挂载。
例如:
When the component mounts...
意思:
组件第一次出现。
卸载。
例如:
Clean up when the component unmounts.
重新挂载。
例如:
Changing the key will force a remount.
这个在 React 面试非常高频。
组件生命周期。
例如:
In class components, you have lifecycle methods.
组件树。
例如:
React walks through the component tree.
父组件。
子组件。
后代组件。
比 child 更正式。
例如:
Context updates all descendants.
传递 props。
例如:
We pass data down through props.
非常常见。
必听懂。
意思:props 一层层传递。
例如:
Context solves the problem of prop drilling.
避免 prop drilling。
React 官方表达。
意思:状态提升。
例如:
We need to lift the state up to the parent component.
保持状态局部。
例如:
You should keep state local whenever possible.
非常高级。
意思:把 state 放在使用它的位置附近。
例如:
Colocate state with the component that owns it.
管理状态。
例如:
How do you manage state in React?
保存状态。
更新状态。
修改状态。
注意:React 里面通常负面。
例如:
You should not mutate state directly.
不可变更新。
例如:
Use immutable updates with objects and arrays.
批处理更新。
例如:
React automatically batches state updates.
状态变化过程。
非常重要。
意思:唯一真实数据来源。
例如:
The server should be the source of truth.
单一数据源。
例如:
Redux provides a single source of truth.
这个非常容易误解。
不是:“钩进去”。
意思:接入。
例如:
Hooks allow you to hook into React features.
意思:
Hooks 让你接入 React 能力。
调用 hook。
例如:
You can only call hooks at the top level.
Hooks 规则。
例如:
You have to follow the Rules of Hooks.
自定义 hook。
抽离逻辑到 hook。
非常常见。
例如:
We can extract this logic into a custom hook.
复用逻辑。
封装逻辑。
高级工程师喜欢说。
例如:
This hook encapsulates all the authentication logic.
副作用。
例如:
useEffect is used for side effects.
执行 effect。
例如:
The effect runs after rendering.
依赖数组。
依赖变化。
例如:
The effect runs whenever the dependency changes.
缺少依赖。
例如:
ESLint warns about missing dependencies.
无限循环。
例如:
This creates an infinite loop.
清理函数。
例如:
Return a cleanup function from useEffect.
订阅 / 取消订阅。
例如:
Subscribe to WebSocket when mounting and unsubscribe when unmounting.
优化性能。
性能瓶颈。
例如:
The database query is the bottleneck.
昂贵计算。
例如:
This is an expensive computation.
记忆化。
例如:
We can memoize this value with useMemo.
缓存结果。
避免重新计算。
避免无用工作。
这个非常美国工程师。
懒加载。
代码分割。
包大小。
例如:
This increases your bundle size.
非常高频。
意思:发送 JavaScript 给浏览器。
例如:
We don't want to ship unnecessary JavaScript.
Next.js 视频疯狂出现。
客户端 JS。
服务端渲染。
重点。
他们通常这样说:
The server renders HTML first, then React hydrates it on the client.
意思:
服务器生成 HTML,然后客户端 React 接管。
底层。
协调。
例如:
React's reconciliation algorithm compares the old tree and the new tree.
diff 算法。
虚拟 DOM。
Fiber 架构。
调度。
中断渲染。
给更新排序。
并发渲染。
工作循环。
意思:我们这里做的是。
例如:
What we're doing here is creating a custom hook.
为什么有效。
这个很酷的地方是。
这个方案的好处是
这个方案的缺点是
难点是。
例如:
The tricky part is handling stale closures.
有意思的是。
注意。
例如:
Notice that we don't need useEffect here.
注意。
留意。
| 表达 | 意思 |
|---|---|
| clean | 代码干净 |
| elegant | 优雅 |
| simple | 简单 |
| straightforward | 直接 |
| verbose | 啰嗦 |
| complex | 复杂 |
| over-engineered | 过度设计 |
| hacky | 不优雅的 workaround |
| solid | 靠谱 |
| robust | 健壮 |
| scalable | 可扩展 |
| maintainable | 易维护 |
| production-ready | 可上线 |
比如 Syntax.fm:
This is a pretty clean solution.
意思:
这是一个挺漂亮的方案。
This feels a little hacky.
意思:
这个方案有点 hack。
This doesn't scale.
意思:
这个方案不能扩展。
这一部分掌握以后,你看 React 视频会明显提升。
这一部分对你现在最有价值,因为 Jack Herrington、Syntax.fm、Theo、Lee Robinson、Vercel 相关视频 最近大量围绕:
他们讲这些东西的时候,表达方式和官方文档完全不同。
例如官方文档:
React Server Components allow you to render components on the server.
YouTuber:
"The idea here is that we're moving more work to the server so we don't have to ship all that JavaScript to the client."
如果不知道这些固定表达,很难听懂。
他们一般不会说:
Next.js App Router system
而是:
App Router
例如:
With the App Router, everything is built around server components.
意思:
在 App Router 中,一切围绕 Server Components 构建。
旧版本:
Pages Router
例如:
If you're coming from the Pages Router, this might feel different.
意思:
如果你之前使用 Pages Router,这会感觉不一样。
非常重要。
意思:约定优于配置。
Next.js 高频。
例如:
Next.js follows convention over configuration.
意思:
Next.js 通过文件结构约定行为。
文件系统路由。
例如:
Next.js uses file-based routing.
路由片段。
例如:
app:
xxxxxxxxxxapp/dashboard/settings/page.tsx
dashboard
settings
都是 route segments。
嵌套路由。
例如:
App Router gives you nested routes out of the box.
布局。
注意:
他们经常说:
shared layout
共享布局。
持久化布局。
例如:
Layouts persist between navigation.
意思:
切换页面时 layout 不重新渲染。
加载 UI。
例如:
Next.js gives you loading UI with Suspense.
错误边界。
例如:
You can create an error boundary with error.tsx.
服务器组件。
但是他们经常说:
RSC
React Server Components。
客户端组件。
在服务器渲染。
例如:
This component renders on the server.
运行在服务器。
注意:render 和 run 有区别。
例如:
Server Component:
runs on the server
执行在服务器。
客户端执行。
超级高频。
意思:发送 JS 到浏览器。
例如:
Server Components reduce the amount of JavaScript shipped to the browser.
减少发送 JS。
减少客户端 bundle。
把逻辑移动到服务器。
例如:
We can move data fetching logic to the server.
保持客户端轻量。
客户端边界。
例如:
"use client" creates a client boundary.
服务器边界。
跨越客户端/服务器边界。
这个很常见。
例如:
Passing functions across the server/client boundary doesn't work.
标记为客户端组件。
例如:
Adding "use client" marks this component as a client component.
选择客户端渲染。
例如:
You're opting into client-side rendering.
只能客户端使用的功能。
例如:
浏览器 API。
例如:
You need a client component because you're using browser APIs.
访问 DOM。
增加交互。
这是他们描述 Client Component 最常用的话。
例如:
You need a client component when you want to add interactivity.
获取数据。
服务器获取数据。
客户端获取数据。
数据获取策略。
瀑布请求。
非常重要。
例如:
Avoid request waterfalls.
意思:
避免:
A 请求完成后 B 才开始。
并行请求。
例如:
We can fetch these resources in parallel.
数据请求靠近使用位置。
靠近数据源请求。
服务器数据获取。
直接访问数据库。
例如:
Server Components allow direct database access.
Next.js 视频里面最多。
缓存。
缓存层。
缓存命中。
缓存未命中。
缓存失效。
程序员经典:
Cache invalidation is hard.
重新验证。
例如:
Revalidate the cache every 60 seconds.
Incremental Static Regeneration。
他们经常简称:
ISR
静态生成。
动态渲染。
选择动态渲染。
强制动态。
强制静态。
缓存行为。
流式返回。
渐进式返回内容。
渐进渲染。
发送数据块。
尽快渲染。
避免阻塞页面。
Suspense 边界。
备用 UI。
例如:
Show a fallback while data is loading.
暂停渲染。
非常重要。
他们可能这样说:
React suspends by throwing a promise.
服务器 Action。
修改数据。
CRUD 中:
Create Update Delete。
执行修改操作。
处理表单提交。
渐进增强。
这个 Next.js 很喜欢讲。
意思:
没有 JS 也能工作。
直接提交到服务器。
避免写 API route。
替代传统 API 调用。
部署生产。
生产环境。
构建时间。
运行时间。
边缘运行时。
Node 运行时。
冷启动。
Serverless 函数。
水平扩展。
这些建议直接背。
Server Components 好的地方是……
这里最大的收益是……
你不需要再发送这些 JS 到客户端。
把工作从客户端移动到服务器。
这个只运行在服务器。
这个永远不会到浏览器。
这就是边界发挥作用的地方。
代价是……
缺点是……
你需要注意……
开发体验很好。
这是一个有强约束的框架。
Next.js 隐藏了很多复杂度。
框架帮你处理。
开箱即用。
这个极高频。
例如:
Next.js gives you routing out of the box.
无需配置。
非常美国工程师。
意思:
直接能用。
感觉像魔法。
但是你需要理解底层。
到这里,你已经覆盖:
✅ React ✅ Next.js ✅ RSC ✅ Server Actions ✅ Cache ✅ Streaming
这些基本覆盖 Jack Herrington 最近 80% 内容。
这一部分是 Syntax.fm、Jack Herrington、Theo、Matt Pocock、Total TypeScript 这些频道里面非常高频的内容。
很多中国开发者的问题是:
知道:
但是听到真人讲话还是懵。
比如:
"TypeScript is really good at inferring types, but sometimes you need to give it a little help."
如果只懂单词,不知道工程语境,还是听不懂。
类型系统。
例如:
TypeScript has a powerful type system.
静态类型。
例如:
TypeScript gives you static typing.
类型安全。
非常高频。
例如:
This gives us better type safety.
类型检查。
例如:
TypeScript catches errors during type checking.
编译时。
例如:
This error happens at compile time.
运行时。
例如:
TypeScript doesn't exist at runtime.
这个一定要听懂。
运行时错误。
例如:
TypeScript cannot protect you from runtime errors.
提前发现错误。
例如:
TypeScript helps you catch errors early.
防止 bug。
开发体验。
Syntax.fm 非常喜欢说。
例如:
This improves developer experience.
类型注解。
例如:
xxxxxxxxxxconst name: string = "Tom"他们会说:
Add a type annotation here.
显式类型。
例如:
You don't need an explicit type here.
隐式类型。
让 TS 推断。
非常高频。
例如:
Let TypeScript infer the type.
类型推断。
例如:
Type inference is one of TypeScript's strengths.
推断类型。
例如:
TypeScript can infer the return type.
这是高级 TS 视频核心。
泛型。
泛型类型。
泛型函数。
例如:
xxxxxxxxxxfunction identity<T>(value:T){ return value}他们说:
We make this function generic.
让它泛化。
复用类型逻辑。
类型参数。
例如:
<T>
传入类型参数。
例如:
xxxxxxxxxxuseState<string>()他们可能说:
Pass the type argument explicitly.
泛型约束。
例如:
xxxxxxxxxx<T extends object>
限制泛型。
更灵活。
更类型安全。
定义类型。
例如:
Let's define a type for this object.
创建类型别名。
非常重要。
TS 人经常说:
Object shape
意思:
对象结构。
例如:
xxxxxxxxxx{ name:string; age:number;}
描述结构。
建模数据。
例如:
We model our API response using TypeScript types.
表示数据。
联合类型。
例如:
xxxxxxxxxxstring | number
缩小联合类型。
可辨识联合。
高级 TS 视频大量出现。
穷尽检查。
例如:
switch:
xxxxxxxxxxdefault: never
交叉类型。
这个必须掌握。
类型缩小。
缩小类型。
类型保护。
例如:
xxxxxxxxxxtypeof value === "string"
检查类型。
运行时检查。
控制流分析。
TypeScript 内部机制。
类型谓词。
例如:
xxxxxxxxxxvalue is User
内置工具类型。
转换类型。
派生类型。
非常高频。
例如:
We derive this type from the API response.
挑选。
排除。
部分。
必需。
只读。
映射对象。
条件类型。
映射类型。
模板字符串类型。
类型层编程。
类型体操。
这个非常口语。
意思:
复杂类型技巧。
例如:
This is some crazy TypeScript gymnastics.
把 TS 用过头。
Syntax.fm 很喜欢。
Schema。
不要翻译成:
模式。
工程里:
数据结构定义。
定义 schema。
例如:
xxxxxxxxxxconst UserSchema = z.object({})
验证数据。
运行时验证。
解析数据。
例如:
xxxxxxxxxxschema.parse(data)
安全解析。
从 schema 推断类型。
例如:
Zod:
xxxxxxxxxxtype User = z.infer<typeof UserSchema>
单一来源。
他们常说:
The schema becomes the single source of truth.
给 API response 加类型。
生成类型。
例如:
Generate types from OpenAPI.
端到端类型安全。
非常热门。
例如:
tRPC。
前后端共享类型。
契约。
例如:
API contract
破坏契约。
TS 在这里帮不了你。
例如:
runtime 数据。
让 TS 自动完成。
编译器知道。
例如:
The compiler knows this value is a string.
编译器推断不了。
需要给 TS 一点提示。
提供更好的自动补全。
改善开发体验。
完全类型安全。
不安全。
非常重要。
意思:
逃生口。
TypeScript:
xxxxxxxxxxas any例如:
any is an escape hatch.
典型。
意思:
强制告诉 TS。
例如:
xxxxxxxxxxas User
| 表达 | 意思 |
|---|---|
| type-safe | 类型安全 |
| ergonomic | 使用舒服 |
| boilerplate | 模板代码 |
| verbose | 冗长 |
| expressive | 表达能力强 |
| flexible | 灵活 |
| strict | 严格 |
| loose | 宽松 |
| maintainable | 可维护 |
| scalable | 可扩展 |
| composable | 可组合 |
例如:
Syntax.fm:
"I love this API because it's really ergonomic."
意思:
我喜欢这个 API,因为它非常好用。
Theo:
"This is a little too much TypeScript magic."
意思:
这里 TS 魔法太多。
Matt Pocock:
"Make invalid states impossible."
这是 TypeScript 世界非常经典的一句话。
意思:
让非法状态无法存在。
建议直接背:
TypeScript can infer most of this automatically.
TS 大部分可以自动推断。
We only need to add annotations when inference fails.
只有推断失败才需要写类型。
This gives us end-to-end type safety.
提供端到端类型安全。
The compiler will catch this before runtime.
编译阶段发现错误。
This is a runtime problem, not a TypeScript problem.
这是运行时问题,不是 TS 问题。
We can model this with a discriminated union.
可以用可辨识联合建模。
Let's derive the type from the schema.
从 schema 派生类型。
This avoids duplicating types.
避免重复定义类型。
This keeps our types in sync.
保持类型同步。
The downside is more complexity.
缺点是复杂度增加。
到这里,你已经覆盖:
✅ React ✅ Next.js ✅ TypeScript
基本就是 Jack Herrington + Syntax.fm 的核心语言。
比如:
这些词在高级前端节目里出现频率极高。
这一部分非常重要,因为 Jack Herrington、Syntax.fm、Theo、Vercel 工程师 经常讲:
而这些视频最大的难点是:
他们不会说:
"We should reduce JavaScript bundle size."
他们更可能说:
"You're shipping way too much JavaScript to the client."
或者:
"This creates unnecessary work on the main thread."
所以这一部分专门整理真实节目里的表达。
性能。
但是他们很少单独说。
常见:
Performance optimization
性能优化。
优化。
例如:
We need to optimize this component.
优化方案。
瓶颈。
非常高频。
例如:
Let's find the bottleneck first.
意思:
先找瓶颈。
定位瓶颈。
测量性能。
高级工程师一定会说。
例如:
Don't optimize before you measure.
不要没有测量就优化。
基准测试。
例如:
Let's benchmark these two approaches.
性能分析。
React DevTools:
React Profiler
分析应用性能。
真实用户性能。
打包产物。
例如:
The final bundle is too large.
包大小。
增加包大小。
减少包大小。
非常常见。
意思:包膨胀。
例如:
Your app has a lot of bundle bloat.
超级高频。
意思:发送 JS 给浏览器。
例如:
We don't want to ship unnecessary JavaScript.
发送太多 JS。
这是 Next.js 视频核心。
JS 负载。
例如:
Reduce the JavaScript payload.
客户端 bundle。
服务器 bundle。
树摇。
意思:删除未使用代码。
例如:
The bundler removes unused code through tree shaking.
死代码删除。
删除没用代码。
只导入需要的东西。
例如:
不要导入整个库:
xxxxxxxxxximport lodash from "lodash"而是导入用到的方法:
xxxxxxxxxximport debounce from "lodash/debounce"
代码分割。
拆 bundle。
按需加载代码。
懒加载。
延迟加载。
推迟加载。
需要时加载。
非常重要。
它最初源于报纸行业,指报纸对折后,无需展开就能直接看到的版面上半部分。这一区域是读者最先看到、最醒目的位置,因此常用来放置重大新闻标题或重要广告。
在现代网页设计中,这个词被引申为用户打开网页后,无需向下滚动屏幕即可直接看到的内容区域。这一区域对用户体验和转化率至关重要,通常用来放置核心信息、品牌Logo或关键的行动按钮。
意思:首屏,无需滚动即可看到的网页区域。
例如:
Only load what's needed above the fold.
首屏下面。
首次加载。
首次页面加载。
高级视频经常出现。
浏览器渲染流程。
浏览器引擎。
解析 HTML。
解析 CSS。
构建 DOM 树。
构建 CSSOM。
渲染树。
布局。
绘制。
合成。
非常高级。
(布局抖动)是指网页中反复强制浏览器重新计算页面布局,导致性能严重下降的现象。
意思:频繁触发布局计算。
例如:
Reading and writing layout repeatedly causes layout thrashing.
触发布局。
触发回流。
触发重绘。
避免不必要布局。
这个非常常听。
主线程。
阻塞主线程。
例如:
Heavy JavaScript blocks the main thread.
主线程工作。
长任务。
例如:
Avoid long tasks over 50ms.
把工作移出主线程。
Web Worker。
不必要重新渲染。
渲染太频繁。
昂贵渲染。
复杂组件。
“Memoize”(记忆化) 是指将函数的计算结果缓存起来,当再次传入相同参数时,直接返回缓存结果,而不再重新执行函数。
缓存组件。
缓存值。
缓存函数。
避免重新创建对象。
稳定引用。
非常高级。
例如:
useMemo helps stabilize references.
引用相等。
对象身份。
水合。
让 React 接管页面。
水合不匹配。
非常高频。
服务器生成的 HTML。
客户端生成的 HTML。
HTML 不匹配。
React 抛 warning。
修复 hydration 问题。
核心网页指标。
Largest Contentful Paint。
最大内容绘制。
Cumulative Layout Shift。
累计布局偏移。
Interaction to Next Paint。
交互响应。
Time To First Byte。
首字节时间。
The first thing I would do is measure.
第一步先测量。
Don't optimize blindly.
不要盲目优化。
This is a premature optimization.
这是过早优化。
The bottleneck is actually somewhere else.
瓶颈其实在别处。
This doesn't scale well.
这个不能很好扩展。
This adds unnecessary overhead.
增加了不必要开销。
We are doing too much work.
做了太多工作。
The browser has to do extra work.
浏览器需要额外处理。
This delays the first render.
延迟首次渲染。
This improves perceived performance.
提升感知性能。
| 英文 | 意思 |
|---|---|
| overhead | 额外开销 |
| latency | 延迟 |
| throughput | 吞吐量 |
| bottleneck | 瓶颈 |
| trade-off | 权衡 |
| cost | 代价 |
| impact | 影响 |
| regression | 性能退化 |
| baseline | 基线 |
| benchmark | 基准测试 |
| profiling | 分析 |
| optimization | 优化 |
| scalable | 可扩展 |
"You're paying the cost of hydration even if the component is not interactive."
意思:
即使组件没有交互,你仍然付出了 hydration 成本。
"The browser has to download, parse, and execute all of this JavaScript."
意思:
浏览器需要下载、解析、执行这些 JS。
"This creates unnecessary work on the main thread."
意思:
这给主线程增加了不必要工作。
"The goal is to move work away from the client."
意思:
目标是减少客户端工作。
"Measure first, optimize second."
先测量,再优化。
到这里,你已经掌握了:
✅ React 语言 ✅ Next.js 语言 ✅ TypeScript 语言 ✅ Performance 语言
下一部分非常推荐:
这个会覆盖:
这部分是 Jack Herrington 和 Syntax.fm 讨论“工程设计”时最核心的语言,也是 Senior 面试最需要的。
这一部分非常重要,因为从这里开始,你会进入 Senior Engineer / Staff Engineer 的表达方式。
Jack Herrington、Syntax.fm、Theo 他们很多时候已经不是在讲:
“这个 API 怎么用”
而是在讨论:
也就是说:
Junior 讨论 How(怎么实现)
Senior 讨论 Why(为什么这样设计)
架构。
例如:
Let's talk about the architecture of this application.
应用架构。
系统设计。
设计决策。
例如:
This was an intentional design decision.
这是一个有意的设计决定。
技术决策。
设计模式。
模式。
例如:
This is a common pattern in React applications.
方案。
非常高频。
例如:
There are several approaches to solving this problem.
解决方案。
策略。
例如:
Our caching strategy is simple.
可扩展性。
这是 Senior 必听词。
例如:
Does this approach scale?
意思:
这个方案以后能撑住吗?
扩展。
注意:不是单纯增加服务器。
例如:
This won't scale with a large team.
意思:
团队变大后维护不了。
水平扩展。
垂直扩展。
可维护性。
例如:
We optimize for maintainability.
容易维护的代码。
可读性。
开发体验。
长期维护。
面向未来。
例如:
This solution is more future-proof.
这个是 Senior 高频。
抽象。
增加抽象层。
例如:
We add an abstraction layer between the UI and API.
隐藏复杂度。
例如:
React abstracts away DOM manipulation.
隐藏复杂性。
抽象泄漏。
非常高级。
例如:
This abstraction leaks implementation details.
意思:
你以为隐藏了,实际上底层细节暴露出来了。
过度抽象。
例如:
Don't over-abstract too early.
过早抽象。
类似:
premature optimization。
保持简单。
简单优先。
避免不必要复杂度。
组件架构。
组件边界。
非常重要。
例如:
Think carefully about component boundaries.
关注点分离。
必听。
例如:
We separate business logic from UI logic.
分离职责。
单一职责。
可复用组件。
通用组件。
展示组件。
容器组件。
智能组件。
局部状态。
全局状态。
服务器状态。
React Query 高频。
客户端状态。
派生状态。
真实来源。
例如:
The server is the source of truth.
single source of truth.
同步状态。
重复状态。
通常是负面的意思。
例如:
Avoid duplicating state.
状态同步问题。
状态爆炸。
你之前问过 DAL,这里非常相关。
数据层。
数据访问层。
服务层。
(仓库模式) 是一种软件设计模式,用于在业务逻辑与数据存储(数据库、API、文件等)之间建立一个隔离层。它让业务代码不直接操作数据库,而是通过一个“仓库”接口来获取和保存数据。
Repository 模式。
业务逻辑。
业务规则。
领域逻辑。
不要把业务逻辑放组件。
非常常听。
薄组件。
胖组件。
通常负面。
API 契约。
定义契约。
破坏契约。
compatibility
n.共存;和睦相处;(计算机设备的)兼容性
向后兼容。
破坏性修改。
API 版本管理。
REST API。
API 边界。
封装 API 调用。
集中管理 API 逻辑。
干净代码。
代码坏味道。
“Code smell”(代码坏味道) 是指代码中出现的某种表面症状,暗示其背后可能存在更深层的设计或质量问题。它不是 Bug(程序能正常运行),但会让代码难以阅读、维护和扩展。
非常重要。
例如:
This is a code smell.
意思:
这是一个设计问题信号。
技术债。
偿还技术债。
遗留代码。
重构。
重写。
注意:Senior 通常更谨慎。
渐进迁移。
向后兼容。
避免破坏性修改。
这个是 Senior 面试核心。
权衡。
例如:
Every solution has trade-offs.
代价是。
收益是。
缺点是。
成本是。
取决于场景。
(没有银弹) 是一句源自软件工程领域的经典名言,意指没有任何一种单一的技术、工具或方法,能够一举解决所有复杂问题。
“银弹”源于传说中能一击杀死狼人的子弹,这里比喻“万能解决方案”。
没有万能方案。
非常美国工程师。
取决于需求。
针对……优化。
例如:
Optimize for developer experience.
有意识地做决定。
这些建议背下来。
The main reason we chose this approach is...
我们选择这个方案主要原因是。
The trade-off here is...
这里的权衡是。
The downside is...
缺点是。
This works well for small applications, but it doesn't scale.
小应用很好,但无法扩展。
I would avoid introducing this abstraction too early.
我不会太早引入这个抽象。
We want to keep the components focused on rendering.
我们希望组件专注于渲染。
The business logic should live outside the component.
业务逻辑应该在组件外。
This makes the code easier to test and maintain.
这样代码更容易测试和维护。
We separated the concerns by creating a dedicated layer.
通过独立层分离关注点。
dedicated
adj.专心致志的,献身的;专用的,专门用途的
This gives us flexibility without adding too much complexity.
增加灵活性,同时不过度增加复杂度。
"I don't like adding abstractions until I have a real problem."
我不喜欢没有真实问题就加抽象。
"This is a pretty common pattern."
这是非常常见的模式。
"This keeps our components nice and clean."
让组件保持干净。
"The nice thing about this approach is..."
这个方案好处是。
"The downside is you introduce another layer."
缺点是增加另一层。
"You are trading simplicity for flexibility."
你用简单性换取灵活性。
"This becomes painful at scale."
规模扩大后会痛苦。
"This is where architecture starts to matter."
这就是架构开始重要的地方。
| 英文 | 中文 |
|---|---|
| architecture | 架构 |
| trade-off | 权衡 |
| scalability | 扩展性 |
| maintainability | 可维护性 |
| abstraction | 抽象 |
| boundary | 边界 |
| layer | 层 |
| separation of concerns | 关注点分离 |
| encapsulation | 封装 |
| coupling | 耦合 |
| cohesion | 内聚 |
| dependency | 依赖 |
| complexity | 复杂度 |
| technical debt | 技术债 |
| migration | 迁移 |
这一部分掌握以后,你会发现:
你看的不再只是“React 教程”,而是在听 Senior Engineer 之间讨论设计。
这个会覆盖:
这些是你看 Jack Herrington 写代码时出现最多的表达。你目前技术没问题,补的就是这一层听力。
这一部分非常贴近你真正看 Jack Herrington / Syntax.fm / Web Dev Simplified / Theo 的场景。
因为他们大量时间不是讲概念,而是在:
他们的语言非常口语化。
比如:
你可能认识:
create a component
但是他们更常说:
"Let's spin up a component real quick."
如果不知道 spin up,就断掉了。
开始吧。
例如:
Let's get started by creating a new Next.js app.
进入代码。
非常常见。
看看代码。
打开 VS Code。
打开 VS Code。
fire up = 启动。
创建项目。
非常高频。
意思:快速生成项目骨架。
例如:
Let's scaffold a Next.js application.
初始化项目。
例如:
Bootstrap a React app.
非常口语。
意思:快速创建并运行。
例如:
Let's spin up a new Next.js app.
配置项目。
安装包。
添加依赖。
加入这个库。
非常口语。
意思:引入 package。
例如:
Let's pull in React Query.
引入依赖。
导入包。
移除依赖。
更新包。
v. 配置。
n. 配置。
配置文件。
例如:
设置配置。
调整配置。
tweak 非常常见。
意思:小调整。
例如:
Let's tweak the Tailwind config.
定制。
覆盖。
例如:
Override the default styles.
构建组件。
创建组件。
组合组件。
React 高频。
例如:
React is all about composing components.
拆成小组件。
抽离组件。
抽离逻辑。
复用组件。
包裹。
例如:
Let's wrap this with a provider.
创建 wrapper。
让它可复用。
超级重要。
这是程序员口语第一梯队。
意思:连接起来,让它工作。
例如:
Let's wire up the API call.
= 把 API 调用接起来。
和 wire up 类似。
例如:
Let's hook up the form.
连接。
集成。
插入。
例如:
We can plug in a different database.
接入。
例如:
We hook into the React lifecycle.
串起来。
改这里。
更新。
修改。
调整。
微调。
重构。
整理代码。
例如:
Let's clean this up.
简化。
移动到。
例如:
Let's move this into a custom hook.
抽出来。
内联。
例如:
We can inline this function.
替换。
替换掉。
swap
v. 交换,交易; 用……替换
非常口语。
例如:
We can swap Redux out for Zustand.
我们可以把 Redux 替换成 Zustand。
调试。
调试过程。
看看发生什么。
检查。
打印,就是console打印。
例如:
Let's log this value out.
加日志。
追踪问题。
找到 bug。
非常常用。
复现问题。
弄清楚发生什么。
深入调查。
查看底层。
缩小问题范围。
非常重要。
例如:
Let's narrow down where the issue is coming from.
根因。
修复。
运行应用。
启动开发服务器。
启动开发服务器。
浏览器打开。
刷新页面。
重新加载。
热更新。
重启服务器。
重新构建。
部署。
提交。
推送。
拉取。
分支。
合并。
创建 Pull Request。
代码 review。
修改。
非常重要。
意思:发布。
例如:
Looks good. Let's ship it.
回滚。
"I'm just gonna create a quick component here."
我快速创建一个组件。
"Let's wire this up."
把功能接起来。
"Now we need to hook this into our API."
现在需要连接 API。
"I'm gonna refactor this a little bit."
我稍微重构一下。
"Let's clean this code up."
整理一下代码。
"This is where things get interesting."
这里开始有意思。
"Here's the tricky part."
这里是难点。
tricky
adj. 难对付的,棘手的;狡猾的,诡计多端的
"The magic happens here."
魔法发生在这里。
"Under the hood, what's happening is..."
底层发生的是。
"Let me show you a better way."
让我展示一个更好的方式。
这个非常值得背:
| 表达 | 意思 |
|---|---|
| spin up | 快速创建 |
| set up | 配置 |
| tear down | 拆除 |
| wire up | 连接 |
| hook up | 接入 |
| plug in | 插入 |
| swap out | 替换 |
| rip out | 移除 |
| clean up | 整理 |
| move around | 移动 |
| pull in | 引入 |
| push out | 推出 |
| roll out | 发布 |
| roll back | 回滚 |
| patch | 修补 |
| ship | 发布 |
比如 Jack Herrington:
"I'm gonna spin up a Next.js project, pull in Prisma, and wire up the database connection."
拆解:
意思:
我要创建一个 Next.js 项目,引入 Prisma,然后连接数据库。
另一个:
"Let's refactor this component and move the logic into a custom hook."
拆解:
意思:
重构组件,把逻辑抽到 custom hook。
再比如:
"The cool thing here is that we don't have to touch the client code."
意思:
这里很棒的是,我们不用修改客户端代码。
到这里,你已经掌握:
✅ 技术概念词 ✅ React / Next.js 专业表达 ✅ TypeScript 表达 ✅ Performance 表达 ✅ Architecture 表达 ✅ Coding Demo 动作表达
比如:
这些不是技术词,但是决定你能不能听懂真人节目。
很多英语不错的开发者,卡在这一层。
这一部分其实非常关键。
因为你现在看的不是英语教学视频,而是美国工程师真实聊天。
他们不会像文档:
"React Server Components provide a mechanism for rendering components on the server."
他们会:
"So basically what we're doing here is we're moving this over to the server, which is kind of nice because we don't have to ship all that stuff anymore."
里面大量都是:
如果不知道这些,你会感觉:
“每个单词都认识,但是整句话不知道什么意思。”
超级高频。
意思:所以简单来说。
例如:
So basically, Server Components run on the server.
理解:
简单来说,Server Components 跑在服务器。
注意:
他们经常:
So basically...
然后开始重新解释。
意思:核心想法是。
例如:
So the idea is we don't send this code to the browser.
非常重要。
意思:问题是 / 关键是。
例如:
The thing is, you don't need useEffect here.
重点是。
例如:
The point is to reduce complexity.
我的意思是。
我说这个的意思是。
换句话说。
基本发生的是。
非常常见。
例如:
Basically what happens is React creates a new render tree.
他们很少绝对化。
有点。
例如:
It's kind of like Redux.
不是完全 Redux。
类似。
例如:
It's sort of a wrapper.
一点点
例如:
This is a little bit complicated.
一点点
例如:
This is a bit cleaner.
非常常见。
注意:不是“漂亮”。
表示:相当。
例如:
This is pretty fast.
= 这个挺快。
基本上。
例如:
That's pretty much it.
= 基本就是这样。
差不多。
相对来说。
例如:
It's relatively simple.
真的。
例如:
This is really useful.
注意。
不是简单:实际上。
更多:纠正。
例如:
A:
React updates the DOM immediately.
B:
Actually, it doesn't.
意思:
等等,其实不是。
字面:真的。
adv. 按照字面意义地,逐字地;真正地,确实地;(用于夸张地强调)简直
程序员口语经常夸张。
例如:
This literally changed everything.
完全。
例如:
Absolutely correct.
肯定。
显然。
注意:有时候不是骂人。
首先。
第一件事。
下一步。
然后。
之后。
从那里开始。
例如:
From there we can add authentication.
此时。
非常高频。
例如:
At this point, we have a working app.
一旦有了这个。
继续。
继续。
进一步。
工程师很常用。
我觉得。
我认为。
我会说。
我可能会。
我猜。
我假设。
取决于。
不确定。
不知道是否。
例如:
I don't know if this is the best approach.
我更喜欢。
我倾向于。
例如:
I tend to keep components small.
通常。
个人来说。
根据我的经验。
Senior 很喜欢。
我的理解方式是。
非常重要。
感觉怪。
感觉不对。
有点别扭。
不是最佳。
烦。
痛苦。
例如:
Managing global state this way is painful.
容易踩坑。
“Footgun”(脚枪) 是编程社区中的俚语,指某个设计或工具极易被误用,导致开发者“开枪打中自己的脚”——即引发难以察觉的 Bug 或事故。
脆弱。
意思:容易坏。
非常高频。
意思:不稳定。
例如:
This solution is pretty brittle.
长期不好维护。
高级表达。
无法扩展。
变乱。
非常常见。
意思:这相当简单明了。
足够简单。
不复杂。
只是……的问题。
例如:
It's just a matter of adding a provider.
基本一行代码。
很简单。
adj. 琐碎的,不重要的;容易解决的,不费吹灰之力的;
变复杂。
事情开始复杂。
这里开始有意思。
这是难点。
有很多边界情况。
有一些注意事项。
/ˈkæviæt/
n. <正式>警告,限制性条款;
有一些坑。
这些你会每天听到。
Let's say we have a user object.
假设我们有一个 user object。
Imagine this scenario.
想象这个场景。
Think about it this way.
这样想。
The way I like to think about it is...
我喜欢这样理解。
The nice thing about this is...
好处是。
The cool thing about this is...
酷的地方是。
The interesting thing is...
有意思的是。
What's happening here is...
这里发生的是。
Under the hood...
底层。
Behind the scenes...
幕后。
Out of the box...
开箱即用。
It just works.
直接能用。
And that's pretty much it.
基本就是这样。
That's all there is to it.
就是这么简单。
Hopefully this makes sense.
希望讲清楚了。
Let me know what you think.
告诉我你的想法。
Thanks for watching.
感谢观看。
原句:
"So basically what we're doing here is we're creating a server component that fetches the data, which is kind of nice because we don't have to worry about loading states on the client."
拆解:
简单来说。
我们这里做的是。
创建 Server Component。
获取数据。
这个挺好的。
因为。
我们不用担心。
客户端 loading 状态。
完整意思:
简单来说,我们创建一个 Server Component 来获取数据,这挺好的,因为客户端不需要处理 loading 状态。
这些词不要逐字翻译:
| 词 | 实际作用 |
|---|---|
| basically | 开始解释 |
| actually | 纠正 |
| kind of | 降低绝对性 |
| pretty | 加强程度 |
| just | 弱化 |
| really | 强调 |
| you know | 停顿 |
| like | 举例/停顿 |
| so | 连接上下文 |
| right | 确认对方理解 |
到这里,你已经接近可以听懂真实节目了。
目前覆盖:
✅ React 专业词 ✅ Next.js 专业词 ✅ TypeScript 专业词 ✅ Performance ✅ Architecture ✅ Coding Demo ✅ 美国工程师口语习惯
例如:
这些词很多中国开发者“认识”,但是在节目语境里经常理解错。这个部分会非常适合 Senior 面试和听 YouTube。
这一部分非常重要。
因为很多高级前端词汇,你单独看定义都会,但是在 YouTube 里听到时,经常因为语境不同而误解。
比如:
你看到:
render
你可能理解:
“浏览器显示页面”
但是 React 工程师说:
"React renders the component again."
他的意思其实是:
“React 再次执行组件函数,生成新的 element tree。”
所以这一部分专门讲:
这是 React 视频最高频误区。
很多人翻译:渲染。
但是 React 语境:
React executes your component and creates a new React element tree.
例如:
"This component renders three times."
意思:组件函数执行三次。
不是:
页面真的绘制三次。
常见表达:
Trigger a render
触发 render。
Re-render
重新执行组件。
Render phase
render 阶段。
Commit phase
提交阶段。
挂载。
意思:组件第一次进入 React tree。
例如:
"When the component mounts, we fetch the data."
意思:
组件第一次出现时请求数据。
注意:
mount ≠ render
第一次:
xxxxxxxxxxmount|render phase|commit phase
更新。
例如:
"On every update, React compares the old tree and the new tree."
意思:
每次更新时。
卸载。
例如:
"Clean up when the component unmounts."
很多人混淆。
编译。
意思:代码转换。
例如:
TypeScript:
xxxxxxxxxx.ts↓.js
他们说:
TypeScript gets compiled into JavaScript.
构建。
比 compile 更大。
包含:
例如:
Run the production build.
打包。
把很多文件合并。
例如:
xa.jsb.jsc.js↓bundle.js
压缩。
例如打包时,可能会删除:
xxxxxxxxxxconst user = "Tom"变为:
xxxxxxxxxxconst u="Tom"
部署。
意思:放到服务器。
完整流程:
xxxxxxxxxxCode↓Compile↓Bundle↓Build↓Deploy
Next.js 视频大量出现。
构建时间。
例如:
Static Generation。
"This happens at build time."
意思:
部署前发生。
运行时间。
用户访问之后。
例如:
"This happens at runtime."
服务器运行时。
浏览器运行时。
例子:
Next.js:
xxxxxxxxxxBuild time:generate static HTMLRuntime:handle request
非常容易混。
缓存。
通常:保存结果,避免重复获取。
例如API:
xxxxxxxxxxGET /users第一次:database第二次:cache
常见:
Cache the response.
记忆化。
通常:缓存计算结果。
例如:
React:
xxxxxxxxxxuseMemo(() => expensiveCalculation())
区别:
Cache:数据层。
Memoize:函数计算层。
他们会说:
"Memoization is a form of caching."
意思:
memoization 是一种缓存。
高级 React 视频很常见。
组件内部可变化状态。
例如:
xxxxxxxxxxconst [open,setOpen]
业务数据。
例如:
用户列表:
xxxxxxxxxx[ { id:1, name:"Tom" }]
React Query 里面:
他说:
"Server state is not really state."
意思:
服务器数据虽然叫 state,但性质不同。
服务器数据。
特点:
客户端状态。
例如:
modal open。
很多人混。
依赖。
例如:
package:
xxxxxxxxxx{ "react":"19"}
代码:
xxxxxxxxxximport axiosaxios 是 dependency。
依赖注入。
架构概念。
例如:
不要:
xxxxxxxxxxfunction UserService(){ const db=new Database()}而:
xxxxxxxxxxfunction UserService(db){}
意思:
外部传入依赖。
非常高级。
抽象。
隐藏复杂概念。
例如 React:
你写:
xxxxxxxxxx<Button/>不用关心:
DOM event。
封装。
隐藏内部实现。
例如组件内部:
xxxxxxxxxxstatelogicAPI
外部只看到:
xxxxxxxxxxprops
简单:
Abstraction:“隐藏复杂性”
Encapsulation:“限制访问范围”
YouTuber 很爱讨论。
库。
你调用它。
例如 React。
表达:
You call the library.
框架。
它调用你。
例如:
Next.js。
表达:
The framework controls the flow.
Next.js 高频。
生成 UI。
让 React 接管 HTML。
流程:
Server:
xxxxxxxxxxReact component↓HTML
Browser:
xxxxxxxxxxHTML+JS↓Interactive React app
YouTuber:
"The browser hydrates the server-rendered HTML."
意思:
浏览器让服务器 HTML 变成交互式 React。
Next.js 视频大量出现。
传统:
xxxxxxxxxxClient↓HTTP request↓API endpoint↓Server
现代:
xxxxxxxxxxClient↓Server function↓Database
他们会说:
"Server Actions remove the need for manual API routes."
意思:
减少手写 API。
Server Side Rendering。
请求时生成。
Static Site Generation。
构建时生成。
Incremental Static Regeneration。
静态 + 定期更新。
表达:
"This page is statically generated and revalidated periodically."
React 推荐。
例如:
xxxxxxxxxxsetUser()
直接改。
例如:
xxxxxxxxxxuser.name="Tom"通常 bad。
他们会说:
"Don't mutate state directly."
React 内部经常讲。
组件。
例如:
xxxxxxxxxxfunction Button(){}
元素,jsx的调用结果。
例如:
xxxxxxxxxx<Button/>产生:
xxxxxxxxxx{ type:Button}
React 性能经常出现。
值相等。
例如:
xxxxxxxxxx1 === 1
对象是不是同一个。
例如:
xxxxxxxxxx{} !== {}
他们说:
"React relies on reference equality."
意思:
React 看引用。
表单必听。
受控。
React 管理 value。
非受控。
DOM 管理。
例如:
React Hook Form:
"We use uncontrolled inputs for performance."
React 核心思想。
声明式。
告诉:我要什么。
例如:
xxxxxxxxxx<Button />
命令式。
告诉:怎么做。
例如:
xxxxxxxxxxelement.style.color="red"
YouTuber:
"React lets you write declarative UI."
React renders your component.
不是:React 显示组件。
而是:React 执行组件函数。
This runs on the server.
不是:服务器显示。
而是:代码执行环境是 server。
We cache this value.
缓存计算结果。
This component is expensive.
不是:价格贵。
而是:计算成本高。
This doesn't scale.
不是:不能扩大。
而是:未来复杂度不可控。
Move this logic out.
抽离逻辑。
Lift this state up.
提升 state。
Push state down.
降低 state 位置。
Hydrate the page.
让 React 接管 HTML。
Ship less JavaScript.
减少发送 JS。
The browser does more work.
浏览器负担增加。
This is blocking.
阻塞。
This is synchronous.
同步。
This is async.
异步。
This is deferred.
延迟执行。
This is lazy.
懒加载。
This is eager.
立即加载。
This is stale.
过期数据。
This is reactive.
响应式。
This is derived.
派生。
这一部分结束以后,你基本已经拥有:
“听懂美国高级前端节目”的核心词汇地图。
包括:
因为这些频道经常一口气聊完整技术栈,这部分会让你从“听懂句子”提升到“听懂整个节目”。
这一部分开始进入 真实节目里的技术生态词汇。
因为 Jack Herrington、Syntax.fm、Theo 这类频道有一个特点:
他们不会只讲 React。
他们会说:
"I'm using TanStack Query with tRPC and Zod on the backend, deployed on Vercel with Drizzle talking to Postgres."
对于非母语开发者,这句话的问题不是技术,而是:
一串名词连续出现,大脑没有时间转换。
服务器状态管理。
React Query 最核心定位。
例如:
TanStack Query is a server state management library.
获取数据。
查询。
例如:
xxxxxxxxxxuseQuery()
修改。
例如:
xxxxxxxxxxuseMutation()
查询 key。
非常高频。
例如:
xxxxxxxxxx['users']
缓存数据。
缓存失效。
例如:
After creating a user, we invalidate the users query.
真实意思:让 query 重新获取。
重新请求。
后台重新请求。
过期数据。
新鲜数据。
乐观更新。
高级前端必听。
例如:
Update the UI before the server responds.
回滚。
例如:
If the mutation fails, rollback the optimistic update.
加载状态。
错误状态。
缓存时间。
重试逻辑。
轮询。
预取。
真实节目:
"The nice thing about TanStack Query is that it handles caching, retries, and background refetching for you."
意思:
TanStack Query 帮你处理缓存、重试、后台刷新。
全局状态。
局部状态。
状态仓库。
例如:
Zustand store。
创建 store。
订阅状态。
选择状态。
例如:
Zustand selector。
更新 store。
持久化状态。
例如:
localStorage。
恢复状态。
状态同步。
轻量。
非常常见。
例如:
Zustand is a lightweight state management solution.
少模板代码。
简单 API。
全局 store。
避免 Context 重渲染。
细粒度订阅。
高级表达。
模板代码。
Redux 经典评价。
动作。
reducer。
派发 action。
更新状态树。
不可变更新。
中间件。
开发工具。
可预测状态管理。
现代 React 视频大量出现。
处理表单提交。
表单状态。
字段状态。
受控输入。
非受控输入。
验证。
Schema 验证。
客户端验证。
服务器验证。
错误信息。
显示验证错误。
提交处理函数。
表单库。
例如:
React Hook Form。
定义 schema。
验证输入。
解析数据。
推断类型。
类型推断。
运行时验证。
共享 schema。
真实表达:
"The nice thing about Zod is that you get runtime validation and TypeScript types from the same schema."
意思:
使用zod的好处是: schema 同时提供运行时验证和 TS 类型。
Prisma / Drizzle 视频常出现。
对象关系映射。
数据库层。
查询数据库。
执行查询。
数据库查询。
数据库结构。
迁移。
执行迁移。
创建迁移。
数据库模型。
关系。
例如:
User has Many Posts
一对多。
外键。
索引。
优化查询。
Prisma 客户端。
生成客户端。
类型安全数据库客户端。
查询构建器。
迁移流程。
轻量 ORM。
类似 SQL 的语法。
接近 SQL。
类型安全查询。
接口。
路由处理器。
请求。
响应。
请求数据。
中间件。
认证。
授权。
注意:非常容易混。
Authentication:
你是谁。
Authorization:
你能做什么。
会话。
令牌。
刷新 token。
登录。
注册。
登录。
退出。
保护路由。
检查权限。
基于角色权限。
中间件保护。
session 验证。
认证提供商。
部署。
生产环境。
预览部署。
环境变量。
密钥。
构建流水线。
持续集成部署。
边缘函数。
Serverless 函数。
冷启动。
原句:
"I'm gonna use TanStack Query here because I don't want to manually manage loading states and cache invalidation."
拆:
意思:
我要用 TanStack Query,因为我不想手动管理 loading 状态和缓存失效。
原句:
"The beauty of this stack is that everything is type-safe from the database all the way to the frontend."
拆:
意思:
这个技术栈最大的优点是,从数据库到前端都是类型安全。
原句:
"We can just define the schema once and infer everything from there."
拆:
意思:
我们只需要定义一次 schema,然后全部自动生成。
到这里,你已经覆盖了现代 React 全栈生态:
✅ React ✅ Next.js ✅ TypeScript ✅ Performance ✅ Architecture ✅ Coding Demo ✅ 工程口语 ✅ TanStack ✅ Zustand ✅ Zod ✅ Prisma ✅ Drizzle ✅ Auth ✅ Deployment